{% extends 'base.html' %}
{% block title %}
    最新文章
{% endblock %}
{% block header %}最新文章列表{% endblock %}
{% block content %}
    {% for new_article in new_articles %}
        <div class="card mt-2 mb-2 border-warning">
            <div class="card-body">
                <h4 class="card-title">
                    <span class="badge badge-danger">
                        {{ new_article.get_category_display }}
                    </span>
                    <a href="/article/{{ new_article.article_id }}">
                        {{ new_article.title }}
                    </a>
                </h4>
                <p class="card-text">
                    {{ new_article.content|truncatechars:20 }}...
                </p>
                <small>
                    {{ new_article.post_datetime }}
                    阅读数：{{ new_article.read_count }}
                </small>
            </div>
        </div>
    {% endfor %}
{% endblock %}